<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>数组的方法-find</title>
</head>
<body>
  <script>
    /*
      find: 
        查找，根据条件查找元素，如果找到了，返回第一个满足条件的元素；否则返回undefined
    */

    let nums = [10, 30, 20, 40, 50]
    let r = nums.find(item => item > 30)
    // let r = nums.find(item => {
    //   return item > 100
    // })
    console.log(r)
  </script>
</body>
</html>